import java.util.StringTokenizer;


class P11074_39643 {

	public static void main(String[] args) {
	
		int caseCounter = 1;
		while (true) {
			StringTokenizer st = new StringTokenizer(readLn());
			int s = Integer.parseInt(st.nextToken());
			int t = Integer.parseInt(st.nextToken());
			int n = Integer.parseInt(st.nextToken());
			
			if (s == t && t == n && n == 0) break;
			
			System.out.println("Case " + caseCounter + ":");
			caseCounter++;
			int x = n * s + t * (n + 1);
			
			for (int k = 0; k < n; k++) {
				drawHorizontalLine(t, x);
			
				drawSquares(s, t, n);
			}
			drawHorizontalLine(t, x);
			System.out.println();
		}
	}

	private static StringBuilder drawSquares(int s, int t, int n) {
		StringBuilder sb;
		sb = new StringBuilder();
		
		for (int k = 0; k < s; k++) {
			for (int j = 0; j < n; j++) {
				for (int l = 0; l < t; l++) {
					sb.append("*");
				}
				for (int l = 0; l < s; l++) {
					sb.append(".");
				}
			}
			for (int l = 0; l < t; l++) {
				sb.append("*");
			}
			sb.append("\n");
		}
		
		System.out.print(sb);
		return sb;
	}

	private static StringBuilder drawHorizontalLine(int t, int x) {
		StringBuilder sb = new StringBuilder();
		for (int k = 0; k < t; k++) {
			for (int j = 0; j < x; j++) {
				sb.append("*");
			}
			sb.append("\n");
		}
		
		System.out.print(sb);
		return sb;
	}
	
	static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuffer buffer = new StringBuffer();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char)car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
            System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) { return (null);}
        if ((car < 0) && (buffer.length() == 0)) return (null);
        return (buffer.toString()).trim();
    }
	
}
